home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
ACORNUSERS
/
CBSA
/
EDUCATION
/
WINDOW
/
h
/
WimpIcon
< prev
next >
Wrap
Text File
|
1998-04-05
|
3KB
|
140 lines
//-----------------------------------
// WimpIcon.h
//-----------------------------------
#ifndef WimpIcon_H
#define WimpIcon_H
#include "IconData.h"
#include "WimpWindow.h"
enum buttontype { /* button types */
BIGNORE, /* ignore all mouse ops */
BNOTIFY,
BCLICKAUTO,
BCLICKDEBOUNCE,
BSELREL,
BSELDOUBLE,
BDEBOUNCEDRAG,
BRELEASEDRAG,
BDOUBLEDRAG,
BSELNOTIFY,
BCLICKDRAGDOUBLE,
BCLICKSEL, /* useful for on/off and radio buttons */
BWRITABLE = 15
} ;
class WimpIcon
{
friend class MenuItem;
friend class WimpMenu;
friend class WimpWindow;
public:
enum Flags { /* icon flag set */
ITEXT = 0x00000001, /* icon contains text */
ISPRITE = 0x00000002, /* icon is a sprite */
IBORDER = 0x00000004, /* icon has a border */
IHCENTRE = 0x00000008, /* text is horizontally centred */
IVCENTRE = 0x00000010, /* text is vertically centred */
IFILLED = 0x00000020, /* icon has a filled background */
IFONT = 0x00000040, /* text is an anti-aliased font */
IREDRAW = 0x00000080, /* redraw needs application's help */
INDIRECT = 0x00000100, /* icon data is 'indirected' */
IRJUST = 0x00000200, /* text right justified in box */
IESG_NOC = 0x00000400, /* if selected by right button, don't
* cancel other icons in same ESG */
IHALVESPRITE=0x00000800, /* plot sprites half-size */
IBTYPE = 0x00001000, /* 4-bit field: button type */
ISELECTED = 0x00200000, /* icon selected by user (inverted) */
INOSELECT = 0x00400000, /* icon cannot be selected (shaded) */
IDELETED = 0x00800000, /* icon has been deleted */
IFORECOL = 0x01000000, /* 4-bit field: foreground colour */
IBACKCOL = 0x10000000 /* 4-bit field: background colour */
} ;
private:
int window_handle;
int handle;
int xmin;
int ymin;
int xmax;
int ymax;
int flags;
union
{
char text[12];
char sprite_name[12];
struct
{
char *text;
char *filter;
int text_lenght;
} indirect_text;
struct
{
union
{
int *sprite;
char *sprite_name;
};
int *sprite_area;
int isname;
}indirect_sprite;
struct
{
char *text;
char *filter;
int text_lenght;
}indirect;
};
IconBlock *data;
public:
enum Direction
{
UP,
DOWN,
LEFT,
RIGHT
} ;
WimpIcon(WimpIcon &,
int = ISPRITE + INDIRECT + IHCENTRE + IBTYPE*BCLICKDEBOUNCE,
int = -1, int = 0,
int = 0, int = 0, int = 70, int = 76);
WimpIcon(char *,
int = ISPRITE + IHCENTRE + IBTYPE*BCLICKDEBOUNCE,
int = -1, int = 0,
int = 0, int = 0, int = 70, int = 76);
/* WimpIcon(Sprite &,
int = ISPRITE + INDIRECT + IHCENTRE + IBTYPE*BCLICKDEBOUNCE,
int = -1, int = 0
int = 0, int = 0, int = 70, int = 76); */
WimpIcon(WimpWindow &, int);
~WimpIcon();
operator int();
void Delete();
void GetState();
void drag();
void write(char *, ...);
void read(char *);
};
#endif